<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta name="author" content="qjh">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">

    <title>人事报表</title>
    <!-- Bootstrap core CSS -->
    <link th:href="@{/webjars/bootstrap/4.4.1-1/css/bootstrap.css}" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
    <link th:href="@{/iconfont/iconfont.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */
        /*不透明度，0.99-1*/
        @-webkit-keyframes chartjs-render-animation {
            from {opacity: 0.99}
            to {opacity: 1}
        }
        @keyframes chartjs-render-animation {
            from {opacity: 0.99}
            to {opacity: 1}
        }
        /*float:left;(左浮动)他使得指定元素脱离普通的文档流而产生的特别的布局特性。并且float必需应用在块级元素之上,right同理*/
        .info{
            float: left;
        }
        .pagination{
            float:right;
        }
        .add{
            float:left;
        }
        .navbar-form {
            float: right;
        }
    </style>
</head>

<body>
<!--引入抽取的topbar-->
<!--模板名：会使用thymeleaf的前后缀配置规则进行解析-->
<div th:replace="commons/bar::topbar"></div>

<div class="container-fluid">
    <div class="row">
        <!--引入侧边栏,将公共片段替换掉声明引入的标签-->
        <div th:replace="commons/bar::#sidebar(activeUri='reports')"></div>
        <!--				-->
        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <h2 class="add"><a class="btn btn-sm btn-success" href="report" th:href="@{/report}">添加</a></h2>
            <form class="navbar-form navbar-right" th:action="@{/depsearch}" method="post">
                <div class="input-group mb-3">
                    <input name="name" type="text" class="form-control" placeholder="Search">
                    <div class="input-group-append">
                        <button class="btn btn-success" type="submit">
                            <span class="iconfont icon-sousuo"></span>
                        </button>
                    </div>
                </div>
            </form>
            <div class="table-responsive">
                <table class="table table-striped table-sm table-bordered">
                    <thead>
                    <tr>
                        <th>员工编号</th>
                        <th>员工姓名</th>
                        <th>部门</th>
                        <th>职位</th>
                        <th>入职时间</th>
                        <th>离职时间</th>
                        <th>部门调动时间</th>
                        <th>岗位调动时间</th>


                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="emp:${pageInfo.list}">
                        <td>[[${emp.id}]]</td>
                        <td>[[${emp.name}]]</td>
                        <td>[[${emp.dept.name}]]</td>
                        <td>[[${emp.position.name}]]</td>
                        <td>[[${emp.edate}]]</td>
                        <td>[[${emp.leaveTime}]]</td>
                        <td>[[${emp.chgDeptTime}]]</td>
                        <td>[[${emp.chgPosTime}]]</td>

                        <!--                        <td>-->
<!--                            <a class="btn btn-sm btn-info" th:href="@{'/searchbyreport/'+${report.id}}">查询</a>-->
<!--                            <a class="btn btn-sm btn-primary" th:href="@{'/report/'+${report.id}}">编辑</a>-->
<!--                            <button th:attr="del_uri=@{'/report/'+${report.id}}" class="btn btn-sm btn-danger deleteBtn">删除</button>-->
<!--                        </td>-->
                    </tr>
                    </tbody>
                </table>

<!--                <a class="btn btn-sm btn-info" >导出入职报表</a>-->
<!--                <a class="btn btn-sm btn-primary" >导出离职报表</a>-->
<!--                <a class="btn btn-sm btn-success" >导出部门调动报表</a>-->
<!--                <a class="btn btn-sm btn-danger" >导出岗位调动报表</a>-->
<!--                <a class="btn btn-sm btn-warning" >导出人事报表</a>-->

                <p class="info">
                    当前第 <span th:text="${pageInfo.pageNum}"></span> 页,总共 <span
                        th:text="${pageInfo.pages}"></span> 页,共 <span
                        th:text="${pageInfo.total}"></span> 条记录
                </p>

                <ul class="pagination">
                    <li class="page-item"><a class="page-link" th:href="@{/reports}">首页</a> </li>
                    <li class="page-item"><a class="page-link" th:href="@{/reports(pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">上一页</a></li>
                    <li class="page-item"><a class="page-link" th:href="@{/reports(pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">下一页</a></li>
                    <li class="page-item"><a class="page-link" th:href="@{/reports(pageNum=${pageInfo.pages})}">尾页</a></li>
                </ul>
                </br>
                </br>
                </br>
                </br>
                <a class="btn btn-sm btn-info" th:href="@{/reports/excel1}">导出入职报表</a>
                <a class="btn btn-sm btn-primary" th:href="@{/reports/excel2}">导出离职报表</a>
                <a class="btn btn-sm btn-success" th:href="@{/reports/excel3}">导出部门调动报表</a>
                <a class="btn btn-sm btn-danger" th:href="@{/reports/excel4}">导出岗位调动报表</a>
                <a class="btn btn-sm btn-warning" th:href="@{reports/excel5}">导出人事报表</a>
            </div>
        </main>
        <form id="deleteDepForm" method="post">
            <input type="hidden" name="_method" value="delete"/>
        </form>
    </div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!--    <script type="text/javascript" th:src="@{/webjars/jquery/3.5.0/jquery.js}"></script>-->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
<script type="text/javascript" th:src="@{/webjars/popper.js/1.14.3/popper.js}"></script>
<script type="text/javascript" th:src="@{/webjars/bootstrap/4.4.1-1/js/bootstrap.js}"></script>
<script >
    $(".deleteBtn").click(function(){
        //删除
        $("#deleteDepForm").attr("action",$(this).attr("del_uri")).submit();
        return false;
    });
</script>
</body>
</html>